﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace GraphConfigTool
{
    public partial class ConfigAddress : Form
    {
        public int dialNumber;//拨码号
        public int location;//引线位置

        public ConfigAddress()
        {
            InitializeComponent();
        }

        private void confirm_Click(object sender, EventArgs e)
        {
            dialNumber = int.Parse(textBox1.Text);
            location = int.Parse(comboBox1.Text);
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void cancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void ConfigAddress_Load(object sender, EventArgs e)
        {
            textBox1.Text = dialNumber.ToString();
            comboBox1.Text = location.ToString();
        }

        private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
            {
                e.Handled = true;
            }
        }
    }
}
